﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WarehouseManagement.BusinessLogic.DTO;
using WarehouseManagement.DataAccess;

namespace WarehouseManagement.BusinessLogic.DTOConverter
{
    public class CustomerConverter
    {
        public static Customer Convert(CustomerDTO dto)
        {
            return new Customer()
            {
                Address = dto.Address,
                BankAccount = dto.BankAccount,
                BankName = dto.BankName,
                ContactPerson = dto.ContactPerson,
                FirstName = dto.FirstName,
                LastName = dto.LastName,
                Email = dto.Email,
                Fax = dto.Fax,
                Id = dto.Id,
                IsActive = dto.IsActive,
                Mobile = dto.Mobile,
                Phone = dto.Phone,
                SkypeAccount = dto.SkypeAccount,
                YahooAccount = dto.YahooAccount
            };
        }

        public static CustomerDTO Convert(Customer entity)
        {
            return new CustomerDTO()
            {
                Address = entity.Address,
                BankAccount = entity.BankAccount,
                BankName = entity.BankName,
                ContactPerson = entity.ContactPerson,
                FirstName = entity.FirstName,
                LastName = entity.LastName,
                Email = entity.Email,
                Fax = entity.Fax,
                Id = entity.Id,
                IsActive = entity.IsActive,
                Mobile = entity.Mobile,
                Phone = entity.Phone,
                SkypeAccount = entity.SkypeAccount,
                YahooAccount = entity.YahooAccount
            };
        }
    }
}
